Returns true if the other object is equal to this one
Syntax
Visual Basic (Declaration) | |
---|
Public Overloads MustOverride Function Equals( _
ByVal other As T _
) As Boolean |
Parameters
- other
Example
Library/Library.Test/TestSalt.cs
C# | Copy Code |
---|
Salt s = new Salt();
Salt scopy = Salt.FromBytes(s.ToArray());
Assert.AreEqual(s, scopy);
Assert.IsTrue(s.Equals(scopy));
Assert.IsTrue(s.Equals((object)scopy));
Assert.IsTrue(s == scopy);
Assert.IsFalse(s != scopy);
Assert.AreEqual(s.GetHashCode(), scopy.GetHashCode());
scopy = new Salt();
Assert.AreNotEqual(s, scopy);
Assert.IsFalse(s.Equals(scopy));
Assert.IsFalse(s.Equals((object)scopy));
Assert.IsFalse(s == scopy);
Assert.IsTrue(s != scopy);
Assert.AreNotEqual(s.GetHashCode(), scopy.GetHashCode()); |
VB.NET | Copy Code |
---|
Dim s As New Salt()
Dim scopy As Salt = Salt.FromBytes(s.ToArray())
Assert.AreEqual(s, scopy)
Assert.IsTrue(s.Equals(scopy))
Assert.IsTrue(s.Equals(DirectCast(scopy, Object)))
Assert.IsTrue(s = scopy)
Assert.IsFalse(s <> scopy)
Assert.AreEqual(s.GetHashCode(), scopy.GetHashCode())
scopy = New Salt()
Assert.AreNotEqual(s, scopy)
Assert.IsFalse(s.Equals(scopy))
Assert.IsFalse(s.Equals(DirectCast(scopy, Object)))
Assert.IsFalse(s = scopy)
Assert.IsTrue(s <> scopy)
Assert.AreNotEqual(s.GetHashCode(), scopy.GetHashCode()) |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also